{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 26,
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "\n",
    "# df = pd.read_csv(\"/Users/zyw/Downloads/wifi抓包源数据 - 865085058551156.csv\")\n",
    "df = pd.read_csv(\"/Users/zyw/Downloads/01业务日用量明细报表_20220719173826_760764.csv\", dtype={\"数据用量(MB)\":str})"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "outputs": [
    {
     "data": {
      "text/plain": "                  日期         MSISDN                   ICCID   数据用量(MB)  \\\n217880  2022-07-17\\t  1440820732975  898604821221D0112975\\t  1,282.742   \n194301  2022-07-17\\t  1440820730205  898604821221D0110205\\t  1,116.245   \n213089  2022-07-17\\t  1440820732814  898604821221D0112814\\t  1,082.786   \n236182  2022-07-17\\t  1440820732666  898604821221D0112666\\t  1,022.291   \n205351  2022-07-17\\t  1440820730262  898604821221D0110262\\t  1,021.385   \n...              ...            ...                     ...        ...   \n173751  2022-07-17\\t  1440820670356  898604821221D0050356\\t      0.000   \n173753  2022-07-17\\t  1440818376600  89860481122190690100\\t      0.000   \n173755  2022-07-17\\t  1440818371538  89860481122190685038\\t      0.000   \n173762  2022-07-17\\t  1440818374546  89860481122190688046\\t      0.000   \n252834  2022-07-17\\t  1440820708413  898604821221D0088413\\t      0.000   \n\n        数据套外用量(MB)  短信用量(条)  短信套外用量(条)  语音用量(分钟)  语音套外用量(分钟)       vol  \n217880         0.0        0          0         0           0  1282.742  \n194301         0.0        0          0         0           0  1116.245  \n213089         0.0        0          0         0           0  1082.786  \n236182         0.0        0          0         0           0  1022.291  \n205351         0.0        0          0         0           0  1021.385  \n...            ...      ...        ...       ...         ...       ...  \n173751         0.0        0          0         0           0     0.000  \n173753         0.0        0          0         0           0     0.000  \n173755         0.0        0          0         0           0     0.000  \n173762         0.0        0          0         0           0     0.000  \n252834         0.0        0          0         0           0     0.000  \n\n[252835 rows x 10 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>日期</th>\n      <th>MSISDN</th>\n      <th>ICCID</th>\n      <th>数据用量(MB)</th>\n      <th>数据套外用量(MB)</th>\n      <th>短信用量(条)</th>\n      <th>短信套外用量(条)</th>\n      <th>语音用量(分钟)</th>\n      <th>语音套外用量(分钟)</th>\n      <th>vol</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>217880</th>\n      <td>2022-07-17\\t</td>\n      <td>1440820732975</td>\n      <td>898604821221D0112975\\t</td>\n      <td>1,282.742</td>\n      <td>0.0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1282.742</td>\n    </tr>\n    <tr>\n      <th>194301</th>\n      <td>2022-07-17\\t</td>\n      <td>1440820730205</td>\n      <td>898604821221D0110205\\t</td>\n      <td>1,116.245</td>\n      <td>0.0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1116.245</td>\n    </tr>\n    <tr>\n      <th>213089</th>\n      <td>2022-07-17\\t</td>\n      <td>1440820732814</td>\n      <td>898604821221D0112814\\t</td>\n      <td>1,082.786</td>\n      <td>0.0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1082.786</td>\n    </tr>\n    <tr>\n      <th>236182</th>\n      <td>2022-07-17\\t</td>\n      <td>1440820732666</td>\n      <td>898604821221D0112666\\t</td>\n      <td>1,022.291</td>\n      <td>0.0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1022.291</td>\n    </tr>\n    <tr>\n      <th>205351</th>\n      <td>2022-07-17\\t</td>\n      <td>1440820730262</td>\n      <td>898604821221D0110262\\t</td>\n      <td>1,021.385</td>\n      <td>0.0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1021.385</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>173751</th>\n      <td>2022-07-17\\t</td>\n      <td>1440820670356</td>\n      <td>898604821221D0050356\\t</td>\n      <td>0.000</td>\n      <td>0.0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0.000</td>\n    </tr>\n    <tr>\n      <th>173753</th>\n      <td>2022-07-17\\t</td>\n      <td>1440818376600</td>\n      <td>89860481122190690100\\t</td>\n      <td>0.000</td>\n      <td>0.0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0.000</td>\n    </tr>\n    <tr>\n      <th>173755</th>\n      <td>2022-07-17\\t</td>\n      <td>1440818371538</td>\n      <td>89860481122190685038\\t</td>\n      <td>0.000</td>\n      <td>0.0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0.000</td>\n    </tr>\n    <tr>\n      <th>173762</th>\n      <td>2022-07-17\\t</td>\n      <td>1440818374546</td>\n      <td>89860481122190688046\\t</td>\n      <td>0.000</td>\n      <td>0.0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0.000</td>\n    </tr>\n    <tr>\n      <th>252834</th>\n      <td>2022-07-17\\t</td>\n      <td>1440820708413</td>\n      <td>898604821221D0088413\\t</td>\n      <td>0.000</td>\n      <td>0.0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0.000</td>\n    </tr>\n  </tbody>\n</table>\n<p>252835 rows × 10 columns</p>\n</div>"
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['vol'] = [i.replace(',','') for i in df['数据用量(MB)']]\n",
    "df['vol'] = [float(i) for i in df['vol']]\n",
    "dfnew = df.sort_values(by='vol', ascending=False)\n",
    "dfnew"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "outputs": [
    {
     "data": {
      "text/plain": "'1323.0'"
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}